<template>
  <div class="AppMask" v-if="loadingShow">
    <div class="loading-view">
      <div class="loading"></div>
      <div>{{text}}</div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "app-mask",
    data() {
      return {}
    },
    props: {
      text: {
        type: String,
        default: '请稍后..'
      },
      loadingShow: {
        type: Boolean,
        default: false
      }
    },
    methods: {}
  }
</script>

<style scoped lang="scss">
  .AppMask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 198903060;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;

    .loading-view {
      width: 100px;
      height: 100px;
      background-color: rgba(0, 0, 0, 0.6);
      border-radius: 10px;
      font-size: 16px;
      color: white;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;

      /* 动画样式 */
      .loading {
        border: 5px solid rgba(0, 0, 0, 0.01);
        border-radius: 50%;
        border-top: 5px solid #fff;
        border-right: 5px solid #fff;
        border-bottom: 5px solid #fff;
        width: 40px;
        height: 40px;
        -webkit-animation: spin 1.4s linear infinite;
        animation: spin 1.4s linear infinite;
        margin-bottom: 10px;
      }

      @-webkit-keyframes spin {
        0% {
          -webkit-transform: rotate(0deg);
        }

        100% {
          -webkit-transform: rotate(360deg);
        }
      }

      @keyframes spin {
        0% {
          transform: rotate(0deg);
        }

        100% {
          transform: rotate(360deg);
        }
      }
    }
  }
</style>
